package irpSample;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bdware.irp.irplib.core.IrpMessage;
import org.bdware.irp.irplib.core.IrpRequest;
import org.bdware.irp.irplib.core.IrpResponse;
import org.bdware.irp.irpserver.IrsHandler;

import java.util.HashMap;
import java.util.Map;

public class SampleIRPHandler implements IrsHandler {
    Logger logger = LogManager.getLogger(SampleIRPHandler.class);

    @Override
    public IrpMessage doidResolve(IrpMessage request) {
        logger.info(request);
        IrpRequest req = (IrpRequest) request;
        String doi = req.getDoid();
        Map<String, String> arg = new HashMap<>();
        arg.put("abc", "def");
        return IrpResponse.newIrsResolveResponse("hellloo", arg);
    }

    @Override
    public IrpMessage createDOID(IrpMessage request) {
        return null;
    }

    @Override
    public IrpMessage batchCreateDOID(IrpMessage request) {
        return null;
    }

    @Override
    public IrpMessage updateDOID(IrpMessage request) {
        return null;
    }

    @Override
    public IrpMessage deleteDOID(IrpMessage request) {
        return null;
    }
}
